#ifndef _TURING_CLASS_HPP_
#define _TURING_CLASS_HPP_

#using "System.dll"
#include <cliext/map>
#include "exceptions.hpp"

using namespace System;

ref struct TapeNode {
	TapeNode^ next;
	TapeNode^ prev;
	Char value;
	TapeNode(Char aValue, TapeNode^ aNext, TapeNode^ aPrev): next(aNext), prev(aPrev), value(aValue){};
};

ref struct CodeDepositValue {
	Char newValue;
	Int32 newState;
	Char movement;
	CodeDepositValue(Char aNewValue, Int32 aNewState, Char aMovement): newValue(aNewValue), newState(aNewState), movement(aMovement){};
};

value struct CodeDepositKey {
	Int32 conditionState; 
	Char conditionValue;
	CodeDepositKey(Char aConditionValue, Int32 aConditionState): conditionState(aConditionState), conditionValue(aConditionValue) {};
};

ref class TuringMachine {
	TapeNode^ mostLeft;
	TapeNode^ pointer;
	Int32 state;
	Collections::Generic::IDictionary<CodeDepositKey, CodeDepositValue^>^ codeDeposit;
	void GoNext();
	void GoPrevious();
	void TapeInitialize(String^ tapeValue);
public:
	property String^ programmName;
	String^ GetTape();
	void Run(String^ tapeValue);
	void CleanTape();
	TuringMachine(String^ filename);
	~TuringMachine();
};
#endif